home *** CD-ROM | disk | FTP | other *** search
/ PC Users 1999 April / Cd Pc Users extra 19 abril 1999.iso / Prog / Inst / Js02 / js02.exe / jscripts / mvtickrightv01.js < prev    next >
Encoding:
JavaScript  |  1998-11-26  |  2.3 KB  |  59 lines

  1. //---------------------------------------------------------
  2. //JavaScript Code For Navigator 4+ and Internet Explorer 4+
  3. //
  4. //---------------------------------------------------------
  5. // Moving Ticker Object Right
  6. //
  7. // signe_browser=0:     Navigator 4
  8. // signe-browser=1:     Internet Explorer 4
  9. // ly:             Ticker Object
  10. // ntxtticker:         Number of Ticker or Object
  11. // contticker:         counter ticker countticker=0 initial value
  12. // tickerRight:         ticker position
  13. // tickerRight=0         initial value for Netscape
  14. // signe_up=0         Initialization
  15. // stepRight:         pixel size for each moving ticker
  16. // dis1:             limit position in left
  17. // dis2:             limit position in right 
  18. // timer:             timeout for moving ticker in millisecond
  19. // ex: mvtickerRight(nbrowser,'copyright',3,1,0,0,5,-200,560,100);
  20. //----------------------------------------------------------
  21.  
  22.  
  23.  
  24. function mvtickerRight(signe_browser,ly,ntxtticker,countticker,tickerRight,signe_up,stepRight,dis1,dis2,timer){
  25.     if (signe_up==0) {
  26.         if (signe_browser==0) tickerRight=document[ly].left;
  27.         signe_up=1;
  28.         var NameDIV=eval("'"+ly+1+"'");
  29.         if (signe_browser==0) document[ly].document[NameDIV].visibility="inherit";
  30.         if (signe_browser==1) document.all[ly].document.all[NameDIV].style.visibility="inherit";
  31.  
  32.     }
  33.  
  34.       if (tickerRight >= dis2 ) {
  35.         tickerRight= dis1;
  36.         if (ntxtticker > 1){
  37.             var NameDIV=eval("'"+ly+countticker+"'");
  38.             if (signe_browser==0) document[ly].document[NameDIV].visibility="hidden";
  39.             if (signe_browser==1) document.all[ly].document.all[NameDIV].style.visibility="hidden";
  40.             countticker=countticker+1;
  41.             if (countticker==ntxtticker+1) countticker=1;
  42.             var NameDIV=eval("'"+ly+countticker+"'");
  43.             if (signe_browser==0) document[ly].document[NameDIV].visibility="inherit";
  44.             if (signe_browser==1) document.all[ly].document.all[NameDIV].style.visibility="inherit";
  45.         }
  46.     }
  47.  
  48.       if (tickerRight < dis2 ) {
  49.           tickerRight=tickerRight+stepRight;
  50.         if (signe_browser==0) document[ly].left=tickerRight;
  51.         if (signe_browser==1) document.all[ly].style.left=tickerRight;
  52.           var timeout_id_mvtickerRight=setTimeout("mvtickerRight("+signe_browser+",'"+ly+"',"+ntxtticker+","+countticker+","+tickerRight+","+signe_up+" ,"+stepRight+","+dis1+","+dis2+","+timer+")", timer);
  53.           return;
  54.     }
  55.  
  56. }
  57.  
  58.  
  59.